package sword.T46;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: 18362
 * @Create: 2022-04-09 17:38:34 星期六
 */

class Solution {
    public int translateNum(int num) {
        String s = String.valueOf(num);
        int dp0 = 1, dp1 = 1;
        for (int i=1; i<s.length(); ++i) {
            if (s.charAt(i-1)=='1' || (s.charAt(i-1)=='2' && s.charAt(i) < '6')) {
                int tmp = dp0 + dp1;
                dp0 = dp1;
                dp1 = tmp;
            } else {
                dp0 = dp1;
            }
        }
        return dp1;
    }
}